<template>
	<view @click="handleClick">
		<image :src="imgurl" />
		<text>{{text}}</text>
	</view>
</template>

<script setup>
	const emit = defineEmits(['click'])

	const props = defineProps({
		imgurl: {
			type: String,
			required: true
		},
		text: {
			type: String,
			required: true
		}
	})
	const handleClick = () => {
		emit('click')
	}
</script>

<style lang="scss" scoped>
	@import '../../styles/_rpx.scss';

	view {
		display: flex;
	}

	image {
		width: rpx(17) !important;
		height: rpx(17) !important;
		margin: auto rpx(8) auto 0;
	}

	text {
		display: flex;
		margin: auto 0;
	}
</style>